import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.less";
import * as antIcons from "@ant-design/icons-vue";

import "./styles/index.less";
import "./styles/ant.less";

// 自定义指令
import directive from "@/utils/directive";
import animation from "@/utils/animation";

// import '@/utils/rem'

const app = createApp(App);
app.use(store);
app.use(router);

app.use(Antd);
// 注册图标组件到全局
Object.keys(antIcons).forEach((key) => {
  app.component(key, (antIcons as any)[key]);
});

app.config.globalProperties.$antIcons = antIcons;

import { setTime,download } from "@/utils";
app.config.globalProperties.$setTime = setTime;
app.config.globalProperties.$download = download;

app.use(directive);
app.use(animation);
app.mount("#app");
